package com.leejxx.health.dao;

import com.github.pagehelper.Page;
import com.leejxx.health.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author LeeJx
 * @ClassName UserDao
 * @Description TODO
 * @date 2020/12/29 16:54
 * @Version 1.0
 */
public interface UserDao {
    User findByUsername(@Param("username") String username);

    Page<User> findByCondition(@Param("queryString") String queryString);

    List<String> findAllUsername();

    void addUser(User user);

    Integer findUserId(@Param("username") String username);

    void insertRoleIdByUserId(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    User findUserByUserId(@Param("userId") Integer userId);

    List<Integer> findRoleIdByUserId(@Param("userId") Integer userId);

    void editUser(User user);

    void deleteRoleIdByUserId(@Param("userId") Integer userId);

    Long findCountOfRoleByUserId(@Param("userId") Integer userId);

    void deleteUserByUserId(@Param("userId") Integer userId);

    String findUserNameByUserId(@Param("userId") Integer userId);

    void editPasswordByUserId(User user);
}
